//获取2022-11-12 11:35:00格式的时间
export const GetNowDate = (): string => {
  // 获取当前时间
  var currentDate = new Date();

  // 获取年份、月份、日期、小时、分钟和秒钟
  var year = currentDate.getFullYear();
  var month = (currentDate.getMonth() + 1).toString().padStart(2, "0"); // 月份从0开始计数，需要加1
  var day = currentDate.getDate().toString().padStart(2, "0");
  var hours = currentDate.getHours().toString().padStart(2, "0");
  var minutes = currentDate.getMinutes().toString().padStart(2, "0");
  var seconds = currentDate.getSeconds().toString().padStart(2, "0");

  // 格式化时间字符串
  var formattedDate = year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
  return formattedDate;
};
